<?php get_header(); ?>
<div id="body">
  <div id="mainBar">
    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); // se sono presenti post mostrali ?>
    <!-- inizio elenco post -->
    <div class="item entry" id="post-<?php the_ID(); ?>">
      <div class="itemhead">				            <h3>
          <a href="<?php the_permalink() ?>" rel="bookmark">
            <?php the_title(); ?></a></h3>
        <div class="chronodata">
          <?php the_time('F jS, Y') ?>
          <!-- by <?php the_author() ?> -->
        </div>
      </div>
      <div class="storycontent">
        <?php the_content('Read more &raquo;'); ?>
      </div>
      <small class="metadata">
        <span class="category">Filed under:
          <?php the_category(', ') ?>
          <? if(!is_single()) echo "|"; ?>
          <?php edit_post_link('Edit', '', ' | '); ?>
          <?php comments_popup_link('Comment (0)', ' Comment (1)', 'Comments (%)'); ?>
        </span>
        <?php if ( function_exists('wp_tag_cloud') ) : ?>
        <?php the_tags('<span class="tags">Article tags: ', ', ' , '</span>'); ?>
        <?php endif; ?>						  </small>
    </div>
    <!-- fine elenco post -->
    
    <?php comments_template(); // mostra l'include dei templates ?>
    
    <?php endwhile; ?>
    
    <div class="navigation"> 
      <div class="alignleft">
        <?php next_posts_link('&laquo; Previous Entries') ?>
      </div>
      <div class="alignright">
        <?php previous_posts_link('Next Entries &raquo;') ?>
      </div>
    </div>
    
    <?php else : // se non sono presenti i post mostra questo codice  ?> 
    
    <h2 class="center">Not Found</h2>
    <p class="center">Sorry, but you are looking for something that isn't here.
    </p>
    <?php endif; ?>
    
  </div>
  <?php get_sidebar(); ?>

<?php get_footer(); ?>